﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using frag_boardgame;

namespace RemoteGame
{
    public class RemoteGame : MarshalByRefObject, IGame
    {

        private static Game game = new Game();

        public RemoteGame()
        {
        }

        public void New()
        {
            Configuraion conf = new Configuraion();
            conf.Cols = 25;
            conf.Rows = 16;
            conf.AddPlayersName("Bob");
            conf.AddPlayersName("Mike");
            conf.AddPlayerPositiion(new Pos(0, 0));
            conf.AddPlayerPositiion(new Pos(10, 10));

            game.New(conf);
        }

        public void MovePlayer(int delta, Direction dir)
        {
            game.MovePlayer(delta, dir);
        }

        public ShootingValues Shoot(int targetId)
        {
            return game.Shoot(targetId);
        }



        #region IGame Members

        public GameData Data
        {
            get { return game.Data; }
        }

        public void FinishCurrentTurn()
        {
            game.FinishCurrentTurn();
        }

        public void Load(System.IO.Stream stream)
        {
            throw new NotImplementedException();
        }

        public void New(Configuraion conf)
        {
            game.New(conf);
        }

        public void Redo()
        {
            game.Redo();
        }

        public void Save(System.IO.Stream stream)
        {
            throw new NotImplementedException();
        }

        public StatisticsTable Statistics
        {
            get { throw new NotImplementedException(); }
        }

        public void Undo()
        {
            game.Undo();
        }

        #endregion
    }
}
